Purpose
The convertEpochToObject task converts an Epoch timestamp into a date string with a specified time/date format.
Potential Use Case
Let's say you have a northbound system that is only capable of providing an Epoch timestamp. The convertEpochToObject task allows you to convert it into a human-readable timestamp for log files or other event records.
Properties
| Incoming | Type | Description | 
|---|---|---|
| epoch | Number | Required. The epoch timestamp to convert. | 
| epochFormat | Enum | Required. The format of the epochtimestamp value. Allowed values are "Seconds" or "Milliseconds". | 
| newFormatString | String | Optional. Represents the format in which the converted time should be displayed. Acceptable formats are identified in the moment.js documentation. | 
| Outgoing | Type | Description | 
|---|---|---|
| convertedTime | Object | The converted time value. Presented in the format specified by the newFormatStringparameter. | 
Examples
Example 1
In this IAP example:
- The - epochvariable is provided by the output of the reference task- convertTimeToEpoch, which is located located elsewhere in the workflow.- Note: The - convertTimeToEpochtask was used only to simulate an incoming Epoch timestamp for this example.
- The reference variable provided by the - convertTimeToEpochtask is- epochTime.
- The - EpochFormatvariable is set to- Seconds.
- The - newFormatStringvariable is set to- LLL, which is the momentum.js locale format for Month name, day of month, year, time.
- For this example, the - convertedTimeproduced upon output will be the value of the- epochtimestamp presented in a human-readable format. 
Example 2
In this IAP example:
- The - epochvariable is provided by the output of the reference task- convertTimeToEpoch, which is located located elsewhere in the workflow.- Note: The - convertTimeToEpochtask was used only to simulate an incoming Epoch timestamp for this example.
- The reference variable provided by the - convertTimeToEpochtask is- epochTime.
- The - EpochFormatvariable is set to- Seconds.
- The - newFormatStringproperty is set to- DD-MMM-YY hh:mm a, which is a date time format for Day-Month-Year hour:min am/pm.
- For this example, the - convertedTimeproduced upon output will be the value of the- epochtimestamp presented in a human-readable format. 
Example 3
In this IAP example:
- The - epochproperty is statically set to the number- 1591045860.
- The - EpochFormatproperty is set to- Seconds.
- The - newFormatStringproperty is set to- DD-MMM-YY hh:mm a, which is a date time format for Day-Month-Year hour:min am/pm.
- For this example, the - convertedTimeproduced upon output will be the value of the- epochtimestamp presented in a human-readable format. In this case the converted timestamp will be- 01-Jun-20 09:11 pm.